var e = {
    getRandom: function(e, n) {
        return n = arguments[1] || 0, Math.floor(Math.random() * (e - n + 1) + n);
    },
    containsPoint: function(e, n, t) {
        return !(n < e.x || n > e.x + e.width || t < e.y || t > e.y + e.height);
    },
    captureTouch: function(e) {
        function n(n) {
            n = n || window.event;
            var o = t ? n.changedTouches[0] : n, u = o.pageX || o.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
            u -= e.offsetLeft;
            var c = o.pageY || o.clientY + document.body.scrollTop + document.documentElement.scrollTop;
            return {
                x: u,
                y: c -= e.offsetTop
            };
        }
        var t = "ontouchend" in document, o = null, u = null, c = null;
        t ? (o = "touchstart", u = "touchmove", c = "touchend") : (o = "mousedown", u = "mousemove", 
        c = "mouseup");
        var l = {
            x: null,
            y: null,
            isPressed: !1,
            event: null
        };
        return document.body.scrollLeft, document.documentElement.scrollLeft, document.body.scrollTop, 
        document.documentElement.scrollTop, e.offsetLeft, e.offsetTop, e.addEventListener(o, function(e) {
            var t = n(e);
            l.x = t.x, l.y = t.y, l.isPressed = !0, l.event = e;
        }, !1), e.addEventListener(c, function(e) {
            l.isPressed = !1, l.x = null, l.y = null, l.event = e;
        }, !1), e.addEventListener(u, function(e) {
            var t = n(e);
            l.x = t.x, l.y = t.y, l.event = e;
        }, !1), l;
    }
};

module.exports = e;